package com.lnsf.bookstore.system.permission.dao;


import java.util.List;
import java.util.Map;

import com.lnsf.bookstore.system.permission.vo.Permission;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

@Repository
public interface PermissionMapper extends Mapper<Permission>{
   
	/**
	 * 根据ID查询子Id，用于删除
	 * @param pid
	 * @return
	 */
	List<Integer> listChildrenIdByPid(@Param("pid") List<Integer> pid);

	/**
	 * 查询全部权限菜单,暂时不用
	 * @return
	 */
	List<Permission> listAll();

	/**
	 * 根据用户Id级联查询权限菜单
	 * @param userId
	 * @param parentId
	 * @return
	 */
	List<Permission> listPermissionByUserId(@Param("userId") Integer userId, @Param("parentId") Integer parentId);


	List<Permission> listByPid(@Param(value = "params") Map<String, Object> params);

	int deleteBatch(Object[] permissionIds);

	
}